﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace MLY.UserControls
{
    public partial class MessagesControl : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void BindData(int OrgId)
        {
            Repeater1.DataSource = Bll.clsMessageForOrg.GetMessages(int.Parse(Session["OrganizationId"].ToString()));
            Repeater1.DataBind();
        }

        public DataSet GetData()
        {
            DataSet ds = new DataSet();
            DataTable dt = new DataTable("News");
            DataRow dr;
            dt.Columns.Add(new DataColumn("Id", typeof(Int32)));
            dt.Columns.Add(new DataColumn("Url", typeof(string)));
            dt.Columns.Add(new DataColumn("Desc", typeof(string)));
            for (int i = 1; i <= 10; i++)
            {
                dr = dt.NewRow();
                dr[0] = i;
                dr[1] = "URL" + i.ToString();
                dr[2] = "Description " + i.ToString();
                dt.Rows.Add(dr);
            }
            ds.Tables.Add(dt);
            Session["dt"] = dt;
            return ds;
        }

    }
}